package switchviz.gui.component;

import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JDialog;

import switchviz.core.mib.MIBDataModel;
import switchviz.core.mib.MIBTestPanel;
import switchviz.network.netswitch.SwitchDataModel;
import switchviz.network.netswitch.SwitchTestPanel;

public class TestNetworkOptionPane extends JDialog implements ActionListener
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 859615862192500720L;

	public TestNetworkOptionPane(Frame owner, SwitchDataModel switchdm)
	{
		super(owner, false);
		SwitchTestPanel content = new SwitchTestPanel(switchdm);
		content.addActionListener(this);
		this.add(content);
		this.setSize(500, 300);
		this.setTitle("Query OIDs on Switch " + switchdm.getName());
		this.setVisible(true);
	}
	
	public TestNetworkOptionPane(Frame owner, MIBDataModel mibdm)
	{
		super(owner, true);
		MIBTestPanel content = new MIBTestPanel(mibdm);
		content.addActionListener(this);
		this.add(content);
		this.setSize(500, 300);
		this.setTitle("Query OID");
		this.setVisible(true);
	}

	public void actionPerformed(ActionEvent e) 
	{
		this.setVisible(false);
	}
}
